/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.star.modules.sys.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.Date;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 房源信息Entity
 *
 * @author L
 * @version 2018-09-04
 */
@Table(name = "${_prefix}house", alias = "a", columns = {
        @Column(name = "id", attrName = "id", label = "用户ID", isPK = true),
        @Column(name = "title", attrName = "title", label = "标题", queryType = QueryType.LIKE),
        @Column(name = "pics", attrName = "pics", label = "图片集最多5张"),
        @Column(name = "price", attrName = "price", label = "价格"),
        @Column(name = "manage_price", attrName = "managePrice", label = "管理费"),
        @Column(name = "month_repair_price", attrName = "monthRepairPrice", label = "月修缮费"),
        @Column(name = "month_manage_price", attrName = "monthManagePrice", label = "月管理费"),
        @Column(name = "price_unit", attrName = "priceUnit", label = "价格单位"),
        @Column(name = "property_type", attrName = "propertyType", label = "物业类型"),
        @Column(name = "house_type", attrName = "houseType", label = "房型格局"),
        @Column(name = "indoor_area", attrName = "indoorArea", label = "室内面积"),
        @Column(name = "build_area", attrName = "buildArea", label = "土地面积"),
        @Column(name = "land_rights", attrName = "landRights", label = "土地权利"),
        @Column(name = "current_status", attrName = "currentStatus", label = "目前状况"),
        @Column(name = "build_date", attrName = "buildDate", label = "建筑年月"),
        @Column(name = "build_construction", attrName = "buildConstruction", label = "建筑构造"),
        @Column(name = "floor_construction", attrName = "floorConstruction", label = "楼层结构"),
        @Column(name = "floors_pos", attrName = "floorsPos", label = "所在楼层"),
        @Column(name = "addr_pic", attrName = "addrPic", label = "物件位置"),
        @Column(name = "longitude", attrName = "longitude", label = "经度"),
        @Column(name = "latitude", attrName = "latitude", label = "纬度"),
        @Column(name = "area_condition", attrName = "areaCondition", label = "地区"),
        @Column(name = "use_condition", attrName = "useCondition", label = "用途"),
        @Column(name = "addr", attrName = "addr", label = "物件地址"),
        @Column(name = "transport_line", attrName = "transportLine", label = "交通线路"),
        @Column(name = "content", attrName = "content", label = "内容", comment = "内容(富文本)"),
        @Column(name = "is_hot", attrName = "isHot", label = "是否热门"),
        @Column(name = "tkd_title", attrName = "tkdTitle", label = "tkd标题"),
        @Column(name = "tkd_keywords", attrName = "tkdKeywords", label = "tkd关键字"),
        @Column(name = "tkd_desc", attrName = "tkdDesc", label = "tkd描述"),
        @Column(name = "rate_of_return", attrName = "rateOfReturn", label = "投资回报率"),
        @Column(includeEntity = DataEntity.class),
}, orderBy = "a.is_hot DESC,a.update_date DESC"
)
public class ShHouse extends DataEntity<ShHouse> {

    private static final long serialVersionUID = 1L;
    private String title;        // 标题
    private String pics;        // 图片集最多5张
    private String price;        // 价格
    private String managePrice;        // 管理费
    private String monthRepairPrice;        // 月修缮费
    private String monthManagePrice;        // 月管理费
    private Integer priceUnit;        // 价格单位
    private Integer propertyType;        // 物业类型
    private String houseType;        // 房型格局
    private Double indoorArea;        // 室内面积
    private Double buildArea;        // 土地面积
    private Integer landRights;        // 土地权利
    private Integer currentStatus;        // 目前状况
    private Date buildDate;        // 建筑年月
    private Integer buildConstruction;        // 建筑构造
    private String floorConstruction;        // 楼层结构
    private Integer floorsPos;        // 所在楼层
    private String addrPic;        // 物件位置
    private String longitude;        // 经度
    private String latitude;        // 纬度
    private Integer areaCondition;        // 地区
    private Integer useCondition;        // 用途
    private String addr;        // 物件地址
    private String transportLine;        // 交通线路
    private String content;        // 内容(富文本)
    private Boolean isHot;
    private String tkdTitle;
    private String tkdKeywords;
    private String tkdDesc;
    private Double rateOfReturn;

    public Double getRateOfReturn() {
        return rateOfReturn;
    }

    public void setRateOfReturn(Double rateOfReturn) {
        this.rateOfReturn = rateOfReturn;
    }

    public ShHouse() {
        this(null);
    }

    public ShHouse(String id) {
        super(id);
    }

    public String getTkdDesc() {
        return tkdDesc;
    }

    public void setTkdDesc(String tkdDesc) {
        this.tkdDesc = tkdDesc;
    }

    @NotBlank(message = "标题不能为空")
    @Length(min = 0, max = 100, message = "标题长度不能超过 100 个字符")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPics() {
        return pics;
    }

    public void setPics(String pics) {
        this.pics = pics;
    }

    @NotNull(message = "价格不能为空")
    @Length(min = 0, max = 40, message = "价格长度不能超过 40 个字符")
    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    @NotNull(message = "管理费不能为空")
    @Length(min = 0, max = 40, message = "管理费不能超过 40 个字符")
    public String getManagePrice() {
        return managePrice;
    }

    public void setManagePrice(String managePrice) {
        this.managePrice = managePrice;
    }

    @Length(min = 0, max = 40, message = "管理费不能超过 40 个字符")
    public String getMonthRepairPrice() {
        return monthRepairPrice;
    }

    public void setMonthRepairPrice(String monthRepairPrice) {
        this.monthRepairPrice = monthRepairPrice;
    }

    @Length(min = 0, max = 40, message = "管理费不能超过 40 个字符")
    public String getMonthManagePrice() {
        return monthManagePrice;
    }

    public void setMonthManagePrice(String monthManagePrice) {
        this.monthManagePrice = monthManagePrice;
    }

    public Integer getPriceUnit() {
        return priceUnit;
    }

    public void setPriceUnit(Integer priceUnit) {
        this.priceUnit = priceUnit;
    }

    @NotNull(message = "物业类型不能为空")
    public Integer getPropertyType() {
        return propertyType;
    }

    public void setPropertyType(Integer propertyType) {
        this.propertyType = propertyType;
    }

    @NotNull(message = "房型格局不能为空")
    @Length(min = 0, max = 40, message = "房型格局不能超过 40 个字符")
    public String getHouseType() {
        return houseType;
    }

    public void setHouseType(String houseType) {
        this.houseType = houseType;
    }

    @NotNull(message = "室内面积不能为空")
    public Double getIndoorArea() {
        return indoorArea;
    }

    public void setIndoorArea(Double indoorArea) {
        this.indoorArea = indoorArea;
    }

    @NotNull(message = "土地面积不能为空")
    public Double getBuildArea() {
        return buildArea;
    }

    public void setBuildArea(Double buildArea) {
        this.buildArea = buildArea;
    }

    @NotNull(message = "土地权利不能为空")
    public Integer getLandRights() {
        return landRights;
    }

    public void setLandRights(Integer landRights) {
        this.landRights = landRights;
    }

    @NotNull(message = "目前状况不能为空")
    public Integer getCurrentStatus() {
        return currentStatus;
    }

    public void setCurrentStatus(Integer currentStatus) {
        this.currentStatus = currentStatus;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "建筑年月不能为空")
    public Date getBuildDate() {
        return buildDate;
    }

    public void setBuildDate(Date buildDate) {
        this.buildDate = buildDate;
    }

    @NotNull(message = "建筑构造不能为空")
    public Integer getBuildConstruction() {
        return buildConstruction;
    }

    public void setBuildConstruction(Integer buildConstruction) {
        this.buildConstruction = buildConstruction;
    }

    @NotBlank(message = "楼层结构不能为空")
    @Length(min = 0, max = 80, message = "楼层结构长度不能超过 80 个字符")
    public String getFloorConstruction() {
        return floorConstruction;
    }

    public void setFloorConstruction(String floorConstruction) {
        this.floorConstruction = floorConstruction;
    }

    @NotNull(message = "所在楼层不能为空")
    public Integer getFloorsPos() {
        return floorsPos;
    }

    public void setFloorsPos(Integer floorsPos) {
        this.floorsPos = floorsPos;
    }

    public String getAddrPic() {
        return addrPic;
    }

    public void setAddrPic(String addrPic) {
        this.addrPic = addrPic;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    @NotNull(message = "地区不能为空")
    public Integer getAreaCondition() {
        return areaCondition;
    }

    public void setAreaCondition(Integer areaCondition) {
        this.areaCondition = areaCondition;
    }

    @NotNull(message = "用途不能为空")
    public Integer getUseCondition() {
        return useCondition;
    }

    public void setUseCondition(Integer useCondition) {
        this.useCondition = useCondition;
    }

    @NotBlank(message = "物件地址不能为空")
    @Length(min = 0, max = 150, message = "物件地址长度不能超过 150 个字符")
    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    @NotBlank(message = "交通线路不能为空")
    @Length(min = 0, max = 100, message = "交通线路长度不能超过 100 个字符")
    public String getTransportLine() {
        return transportLine;
    }

    public void setTransportLine(String transportLine) {
        this.transportLine = transportLine;
    }

    @NotBlank(message = "内容不能为空")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Boolean getIsHot() {
        return isHot;
    }

    public void setIsHot(Boolean hot) {
        isHot = hot;
    }

    public String getTkdTitle() {
        return tkdTitle;
    }

    public void setTkdTitle(String tkdTitle) {
        this.tkdTitle = tkdTitle;
    }

    public String getTkdKeywords() {
        return tkdKeywords;
    }

    public void setTkdKeywords(String tkdKeywords) {
        this.tkdKeywords = tkdKeywords;
    }


    public Double getPrice_gte() {
        return sqlMap.getWhere().getValue("price", QueryType.GTE);
    }

    public void setPrice_gte(Double price) {
        sqlMap.getWhere().and("price", QueryType.GTE, price);
    }

    public Double getPrice_lte() {
        return sqlMap.getWhere().getValue("price", QueryType.LTE);
    }

    public void setPrice_lte(Double price) {
        sqlMap.getWhere().and("price", QueryType.LTE, price);
    }

    public Double getManagePrice_gte() {
        return sqlMap.getWhere().getValue("manage_price", QueryType.GTE);
    }

    public void setManagePrice_gte(Double managePrice) {
        sqlMap.getWhere().and("manage_price", QueryType.GTE, managePrice);
    }

    public Double getManagePrice_lte() {
        return sqlMap.getWhere().getValue("manage_price", QueryType.LTE);
    }

    public void setManagePrice_lte(Double managePrice) {
        sqlMap.getWhere().and("manage_price", QueryType.LTE, managePrice);
    }

    public Double getIndoorArea_gte() {
        return sqlMap.getWhere().getValue("indoor_area", QueryType.GTE);
    }

    public void setIndoorArea_gte(Double indoorArea) {
        sqlMap.getWhere().and("indoor_area", QueryType.GTE, indoorArea);
    }

    public Double getIndoorArea_lte() {
        return sqlMap.getWhere().getValue("indoor_area", QueryType.LTE);
    }

    public void setIndoorArea_lte(Double indoorArea) {
        sqlMap.getWhere().and("indoor_area", QueryType.LTE, indoorArea);
    }

}